package com.project.bean;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 主贴实体类
 */
public class PostBean {
    //主贴id
private Integer id;
 // 主贴标题
private String postName;
//主贴作者
private UserBean postWriter;
//主贴回帖数
private Integer replyNum;
// 主贴内容
    private String postContent;
    //    频道
    private ChannelBean channel;
//    发帖时间
    private LocalDate date = LocalDate.now();
//    回帖集合
    private List<ReplyBean> replyList;

    public PostBean (){

    }

    public PostBean(String postName, Integer postWriter,  String postContent,Integer channel ) {
        this.postName = postName;
        this.postWriter = new UserBean();
        this.postWriter.setId(postWriter);
        this.postContent = postContent;
        this.channel = new ChannelBean();
        this.channel.setId(channel);
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getPostName() {
        return postName;
    }

    public void setPostName(String postName) {
        this.postName = postName;
    }

    public UserBean getPostWriter() {
        return postWriter;
    }

    public void setPostWriter(UserBean postWriter) {
        this.postWriter = postWriter;
    }

    public Integer getReplyNum() {
        return replyNum;
    }

    public void setReplyNum(Integer replyNum) {
        this.replyNum = replyNum;
    }

    public String getPostContent() {
        return postContent;
    }

    public void setPostContent(String postContent) {
        this.postContent = postContent;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public ChannelBean getChannel() {
        return channel;
    }

    public void setChannel(ChannelBean channel) {
        this.channel = channel;
    }

    public List<ReplyBean> getReplyList() {
        return replyList;
    }

    public void setReplyList(List<ReplyBean> replyList) {
        this.replyList = replyList;
    }

    @Override
    public String toString() {
        return "PostBean{" +
                "id=" + id +
                ", postName='" + postName + '\'' +
                ", postWriter=" + postWriter +
                ", replyNum=" + replyNum +
                ", postContent='" + postContent + '\'' +
                ", channel=" + channel +
                ", date=" + date +
                ", replyList=" + replyList +
                "}\n";
    }
}
